﻿using System;
using System.Collections;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace GeneralDFS.Common.Network
{
    public class ChannelHelper
    {
        public static IChannel CreateChannel(String name, int port)
        {
            IDictionary tcpProp = new Hashtable();
            tcpProp["name"] = name;
            tcpProp["port"] = port;
            IChannel channel = new TcpChannel(tcpProp,
            new BinaryClientFormatterSinkProvider(),
            new BinaryServerFormatterSinkProvider());
            return channel;
        }
    }
}
